﻿
/*----------------------------------------------------------------//
// 文件名：MoTester.cs
// 文件功能描述：实体 MoTester.
// 
// 创建标识：2009-02-27
//
// 修改标识：
// 修改描述：
//----------------------------------------------------------------*/
#region MoTester
using System;
using System.Data;
using System.Globalization;
using System.Text;
using System.Xml;
using System.Data.Common;
namespace EQT.Model
{
	/// <summary>
	/// 业务实体MoTester
	/// </summary>
	public partial class MoTester:ICloneable
	{
		#region 表Tester的字段
		private string _co_item_id;
		private string _emp_id;
		private string _duty_code;
		private decimal _duty_weight;
		#endregion
		
		#region 构造函数
		public MoTester()
		{
		    
		    
		    
		    
		}
		#endregion
		
		#region 拷贝构造函数

		public MoTester(MoTester item)
		{
			item.CopyTo(this);
		}
		#endregion
		
		#region 带参数构造函数
	    public MoTester(string co_item_id,string emp_id,string duty_code,decimal duty_weight)
		{
		this._co_item_id=co_item_id;
		this._emp_id=emp_id;
		this._duty_code=duty_code;
		this._duty_weight=duty_weight;
		}
		#endregion
		
		#region 表Tester的字段属性
		/// <summary>
		/// CO_ITEM_ID
		/// </summary>
		public string Co_Item_Id
		{
			get {return _co_item_id;}
			set {_co_item_id=value;}
		}
		/// <summary>
		///人员序号是自增序列。人员编码使用触发器实现。E0001,E0002
		/// </summary>
		public string Emp_Id
		{
			get {return _emp_id;}
			set {_emp_id=value;}
		}
		/// <summary>
		/// DUTY_CODE
		/// </summary>
		public string Duty_Code
		{
			get {return _duty_code;}
			set {_duty_code=value;}
		}
		/// <summary>
		///
		/// </summary>
		public decimal Duty_Weight
		{
			get {return _duty_weight;}
			set {_duty_weight=value;}
		}
		#endregion
		
		#region 辅助函数
		/// <summary>
		/// 拷贝函数
		/// </summary>
		public MoTester CopyTo(MoTester item)
        {
		    item.Co_Item_Id=this.Co_Item_Id;
		    item.Emp_Id=this.Emp_Id;
		    item.Duty_Code=this.Duty_Code;
		    item.Duty_Weight=this.Duty_Weight;
			return item;
        }
		/// <summary>
		/// 克隆函数
		/// </summary>		
		public object Clone()
        {
            MoTester NewTester=new MoTester();
		    NewTester._co_item_id=this._co_item_id;
		    NewTester._emp_id=this._emp_id;
		    NewTester._duty_code=this._duty_code;
		    NewTester._duty_weight=this._duty_weight;
			return NewTester;
		}
		
		private static MoTester _empty = new MoTester(string.Empty,string.Empty,string.Empty,0);
        public static MoTester Empty
        {
            get
            {
                return _empty;
            }
        }
		
		///<summary>
		///判断对象是否相等
		///<summary>
		public override bool Equals(object obj)
        {
            if (base.Equals(obj))
            {
                return true;
            }
            else
            {
                MoTester NewTester = obj as MoTester;
                if (NewTester == null)
                {
                    return false;
                }
                else
                {
				if (NewTester.Co_Item_Id==this.Co_Item_Id && NewTester.Emp_Id==this.Emp_Id && NewTester.Duty_Code==this.Duty_Code && NewTester.Duty_Weight==this.Duty_Weight)		
					{
                        return true; 
                    }
                }

            }
            return false;
            
        }
		///TODO:you should modify GetHashCode by yourself.
		public override int GetHashCode()
		{
			return base.GetHashCode();
		} 

		public override string ToString()
        {
		   return String.Format("Co_Item_Id={0}/Emp_Id={1}/Duty_Code={2}/Duty_Weight={3}",_co_item_id,_emp_id,_duty_code,_duty_weight);
		 
		}
		#endregion
		
		#region DataTable Help Function
		///<summary>
		///DataRow转换成Model
		///</summary>
		public void Row2Model(DataRow row)
		{
		    if(row["Co_Item_ID"]!=null && row["Co_Item_ID"]!=DBNull.Value)
			{
			    this.Co_Item_Id = (string)row["Co_Item_ID"];
			}
			else
			{
				this.Co_Item_Id =string.Empty;
			}
		    if(row["Emp_ID"]!=null && row["Emp_ID"]!=DBNull.Value)
			{
			    this.Emp_Id = (string)row["Emp_ID"];
			}
			else
			{
				this.Emp_Id =string.Empty;
			}
		    if(row["Duty_Code"]!=null && row["Duty_Code"]!=DBNull.Value)
			{
			    this.Duty_Code = (string)row["Duty_Code"];
			}
			else
			{
				this.Duty_Code =string.Empty;
			}
		    if(row["Duty_Weight"]!=null && row["Duty_Weight"]!=DBNull.Value)
			{
			    this.Duty_Weight = (decimal)row["Duty_Weight"];
			}
			else
			{
				this.Duty_Weight =0;
			}
		}
		
		///<summary>
		///Model转换成DataRow
		///</summary>
	　　public void Model2Row(DataRow row)
		{
			row["Co_Item_ID"] = this.Co_Item_Id;
			row["Emp_ID"] = this.Emp_Id;
			row["Duty_Code"] = this.Duty_Code;
			row["Duty_Weight"] = this.Duty_Weight;
		}
		#endregion
	}
}
#endregion
